package cn.edu.zhku.citrusmonitor.baseinfo.pest.dao;

import java.sql.SQLException;
import java.util.List;

import cn.edu.zhku.citrusmonitor.domain.Bean;
import cn.edu.zhku.citrusmonitor.domain.TbPest;

/**
 * @author 欣裕
 * @date 2018年8月2日下午
 * 
 */
public interface PestDao {
	Long getCount() throws SQLException;
	
	/**
	 * 后台查看某条虫害全部信息
	 * @param pestId
	 * @return
	 * @throws SQLException
	 */
	List<TbPest> getPestById(String pestId) throws SQLException;
	
	int addPestByPestBean(TbPest pest) throws SQLException;
	
	TbPest selectById(String pestId) throws SQLException;
	
	int delectPestByPestBean(TbPest pest) throws SQLException;
	
	int modifyPestByPestBean(TbPest pest) throws SQLException;
	
	/**
	 * 获取最近列表，前端显示
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<Bean> getRecentPestBeanList(Integer pageSize) throws SQLException;

	/**
	 * 关键字查找
	 * @param currentPage
	 * @param pageSize
	 * @param word
	 * @return
	 * @throws SQLException
	 */
	List<TbPest> searchPestByWord(Integer currentPage, Integer pageSize, String word) throws SQLException;

	/**
	 * 关键字查找返回 结果数
	 * @param word
	 * @return
	 * @throws SQLException
	 */
	Long searchPestCountByWord(String word) throws SQLException;

	/**
	 * 后台分页
	 * @param currentPage
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<TbPest> getPestDetailBeanList(Integer currentPage, Integer pageSize) throws SQLException;

	/**
	 * 前端分页
	 * @param currentPage
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<Bean> getPestBeanList(Integer currentPage, Integer pageSize) throws SQLException;

	/**
	 * 前端显示虫害正文
	 * @param id
	 * @return
	 * @throws SQLException
	 */
	Bean showPestById(String id) throws SQLException;

	/**
	 * 批量删除
	 * @param ids
	 * @return
	 * @throws SQLException
	 */
	int[] delSelect(String[] ids) throws SQLException;
	
	
}
